package com.zy.business.mapper;

import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.zy.business.domain.TbHoliday;
import org.apache.ibatis.annotations.Param;
import org.apache.ibatis.annotations.Select;

import java.util.List;


/**
 * @Description:打卡提醒Mapper接口
 * @author: zhangxiaojia
 * @date: 2020/7/16 上午 10:45
 */
public interface HolidayMapper extends BaseMapper<TbHoliday> {

    @Select("select type from tb_holiday where date=#{dateStr}")
    Integer getIsHoliday(@Param("dateStr") String dateStr);

    @Select("select count(*) from tb_holiday where date>=#{beginDate} and date<=#{endDate} and type=1")
    Integer getWorkDayNum(@Param("beginDate") String beginDate, @Param("endDate") String endDate);

    @Select("select * from tb_holiday where date like CONCAT(#{month},'%') order by date")
    List<TbHoliday> getListByMonth(@Param("month") String month);

    @Select("select * from tb_holiday where DATE(date)>=#{beginDate} and DATE(date)<=#{endDate}")
    List<TbHoliday> getListBybetween(@Param("beginDate") String beginDate, @Param("endDate") String endDate);
}
